abstract class ApiConstants {
  static const String appBaseUrl = 'https://appx.hunnu.edu.cn';
  static const String portalBaseUrl = 'https://core.hunnu.edu.cn';

  // 阿里巴巴规范状态码
  static const int successCode = 200; // 成功
  static const int invalidTokenCode = 401; // Token失效
  static const int serviceErrorCode = 500; // 服务端错误
  static const int bizErrorCode = 400; // 业务错误
  static const int networkErrorCode = -1; // 网络错误
  static const int timeoutErrorCode = 408; // 请求超时
  static const int forbiddenErrorCode = 403; // 权限不足
  static const int notFoundErrorCode = 404; // 未找到
  static const int unAuthorizedErrorCode = 401; // 未授权
  static const int tooManyRequestsErrorCode = 429; // 请求过多
  static const int unknownErrorCode = 999; // 未知错误
}

abstract class AppDurations {
  static const Duration ms100 = Duration(milliseconds: 100);
  static const Duration ms200 = Duration(milliseconds: 200);
  static const Duration ms300 = Duration(milliseconds: 300);
  static const Duration ms400 = Duration(milliseconds: 400);
  static const Duration ms500 = Duration(milliseconds: 500);
  static const Duration ms600 = Duration(milliseconds: 600);
  static const Duration oneSecond = Duration(seconds: 1);
  static const Duration twoSeconds = Duration(seconds: 2);
  static const Duration fiveSeconds = Duration(seconds: 5);
  static const Duration tenSeconds = Duration(seconds: 10);
  static const Duration sec30 = Duration(seconds: 30);
  static const Duration oneMinute = Duration(minutes: 1);
  static const Duration twoMinutes = Duration(minutes: 2);
}

// core/network/config/network_config.dart
class NetworkConfig {
  final String baseUrl;
  final Duration connectTimeout;
  final Duration receiveTimeout;
  final bool enableLogging;
  final bool enableCache;
  final int maxRetries;

  const NetworkConfig({
    required this.baseUrl,
    this.connectTimeout = const Duration(seconds: 15),
    this.receiveTimeout = const Duration(seconds: 15),
    this.enableLogging = true,
    this.enableCache = false,
    this.maxRetries = 3,
  });
}
